// Copyright (c) 2007 Robin Boerdijk. All rights reserved.
//
// This software is licensed under the terms of the Microsoft Reciprocal License as described 
// in the file LICENSE.txt, which you should have received as part of this distribution. The 
// license terms are also available at http://www.opensource.org/licenses/ms-rl.html.

#ifndef wtk_MenuCommand_h_included
#define wtk_MenuCommand_h_included

#include "wtk/MenuItem.h"
#include "wtk/Event.h"

#include <string>

namespace wtk
{
	class MenuCommand : public MenuItem
	{
	public:

		MenuCommand(Menu *ownerMenu, const std::wstring &title, Separation separation = NoSeparation);

		template<class HandlerClass> void OnSelect(HandlerClass *object, void (HandlerClass::*method)(MenuCommand *sender))
		{
			m_selectEvent.AddHandler(object, method);
		}

	protected:

		virtual HMENU GetSubMenuHandle();

	private:

		friend class Window;

		Event<MenuCommand> m_selectEvent;
	};
}

#endif